import Vue from 'vue'
import VueRouter from 'vue-router'

Vue.use(VueRouter)

export default new VueRouter({
    mode: 'history',
    base: process.env.BASE_URL,
    routes: [
        {
            path: '/',
            name: 'home',
            meta: {
                requireAuth: true
            },
            component: () => import(/* webpackChunkName: "home" */ '@/pages/layout'),
            redirect: '/shop/manage',
            children: [
                {
                    path: 'dashboard',
                    name: '商家首页',
                    component: () => import(/* webpackChunkName: "home" */ '@/pages/index/dashboard'),
                    meta: {
                        requireAuth: true,
                        navList: ['商家首页']
                    }
                },
                {
                    path: 'shop',
                    name: '商品管理',
                    component: () => import(/* webpackChunkName: "merchant" */ '@/pages/common/base'),
                    redirect: 'manage',
                    meta: {
                        requireAuth: true,
                        navList: ['商品管理']
                    },
                    children: [
                        {
                            path: 'manage',
                            name: '商品列表',
                            component: () => import(/* webpackChunkName: "merchant" */ '@/pages/shop/manage/index'),
                            meta: {
                                requireAuth: true,
                                navList: ['商品管理', '商品管理']
                            }
                        },
                        {
                            path: 'category',
                            name: '分类管理',
                            component: () => import(/* webpackChunkName: "merchant" */ '@/pages/shop/category/index'),
                            meta: {
                                requireAuth: true,
                                navList: ['商品管理', '分类管理']
                            }
                        }
                    ]
                },
                {
                    path: 'fenRed',
                    name: '分红管理',
                    component: () => import(/* webpackChunkName: "merchant" */ '@/pages/common/base'),
                    redirect: 'manage',
                    meta: {
                        requireAuth: true,
                        navList: ['商品管理']
                    },
                    children: [
                        {
                            path: 'fenRedManage',
                            name: '商品列表',
                            component: () => import(/* webpackChunkName: "merchant" */ '@/pages/fenRed/fenRedManage/index'),
                            meta: {
                                requireAuth: true,
                            }
                        },
                    ]
                },
                {
                    path: 'merchant',
                    name: '系统设置',
                    component: () => import(/* webpackChunkName: "merchant" */ '@/pages/common/base'),
                    redirect: 'verify',
                    meta: {
                        requireAuth: true
                    },
                    children: [
                        {
                            path: 'verify',
                            name: '菜单管理',
                            component: () => import(/* webpackChunkName: "merchant" */ '@/pages/merchant/verify/index'),
                            meta: {
                                requireAuth: true,
                                navList: ['系统设置', '菜单管理']
                            }
                        },
                        {
                            path: 'origin',
                            name: '组织架构',
                            component: () => import(/* webpackChunkName: "merchant" */ '@/pages/merchant/origin/index'),
                            meta: {
                                requireAuth: true,
                                navList: ['系统设置', '组织架构']
                            }
                        },
                        {
                            path: 'verify/create',
                            name: '新增菜单',
                            component: () => import(/* webpackChunkName: "merchant" */ '@/pages/merchant/verify/create'),
                            meta: {
                                requireAuth: true,
                                navList: ['系统设置', '菜单管理', '新增菜单']
                            }
                        },
                        {
                            path: 'verify/update',
                            name: '编辑菜单',
                            component: () => import(/* webpackChunkName: "merchant" */ '@/pages/merchant/verify/update'),
                            meta: {
                                requireAuth: true,
                                navList: ['系统设置', '菜单管理', '编辑菜单']
                            }
                        },
                        {
                            path: 'verify/detail',
                            name: '审核详情',
                            component: () => import(/* webpackChunkName: "merchant" */ '@/pages/merchant/verify/detail'),
                            meta: {
                                requireAuth: true,
                                navList: ['商户管理', '商户审核', '审核详情']
                            }
                        },
                        {
                            path: 'verify/verify',
                            name: '重新认证',
                            component: () => import(/* webpackChunkName: "merchant" */ '@/pages/merchant/verify/verify'),
                            meta: {
                                requireAuth: true,
                                navList: ['商户管理', '商户审核', '重新认证']
                            }
                        },
                        {
                            path: 'list',
                            name: '组织列表',
                            component: () => import(/* webpackChunkName: "merchant" */ '@/pages/merchant/list/index'),
                            meta: {
                                requireAuth: true,
                                navList: ['系统设置', '组织架构']
                            }
                        }
                    ]
                },
                {
                    path: 'yunying',
                    name: '运营管理',
                    component: () => import(/* webpackChunkName: "merchant" */ '@/pages/common/base'),
                    redirect: 'qudao',
                    meta: {
                        requireAuth: true
                    },
                    children: [
                        {
                            path: 'qudao',
                            name: '渠道管理',
                            component: () => import(/* webpackChunkName: "merchant" */ '@/pages/yunying/qudao/index'),
                            meta: {
                                requireAuth: true,
                            }
                        },
                        {
                            path: 'productImg',
                            name: '产品页图片',
                            component: () => import(/* webpackChunkName: "merchant" */ '@/pages/yunying/productImg/index'),
                            meta: {
                                requireAuth: true,
                            }
                        },
                        {
                            path: 'userLaw',
                            name: '用户协议',
                            component: () => import(/* webpackChunkName: "merchant" */ '@/pages/yunying/userLaw/index'),
                            meta: {
                                requireAuth: true,
                            }
                        },

                    ]
                },
                {
                    path: 'market',
                    name: '营销管理',
                    component: () => import(/* webpackChunkName: "market" */ '@/pages/common/base'),
                    redirect: 'coupon', // 根据实际需求修改重定向路径
                    meta: {
                        requireAuth: true
                    },
                    children: [
                        {
                            path: 'coupon',
                            name: '优惠券监控',
                            component: () => import(/* webpackChunkName: "market" */ '@/pages/market/coupon/index'),
                            meta: {
                                requireAuth: true,
                                navList: ['营销管理', '优惠券监控']
                            }
                        },
                        {
                            path: 'ticket',
                            name: '电票监控',
                            component: () => import(/* webpackChunkName: "market" */ '@/pages/market/ticket/index'),
                            meta: {
                                requireAuth: true,
                                navList: ['营销管理', '电票监控']
                            }
                        },
                        {
                            path: 'ticketDetails',
                            name: '电票领取明细',
                            component: () => import(/* webpackChunkName: "market" */ '@/pages/market/ticket/detail'),
                            meta: {
                                requireAuth: true,
                                navList: ['营销管理', '电票领取明细']
                            }
                        }
                    ]
                },
                {
                    path: 'finance',
                    name: '财务管理',
                    component: () => import(/* webpackChunkName: "finance" */ '@/pages/common/base'),
                    redirect: 'paymentRecord',
                    meta: {
                        requireAuth: true
                    },
                    children: [
                        {
                            path: 'paymentRecord',
                            name: '支付记录', // 修改名称以匹配实际功能
                            component: () => import(/* webpackChunkName: "finance" */ '@/pages/finance/paymentRecord/index'),
                            meta: {
                                requireAuth: true,
                                navList: ['财务管理', '支付记录']
                            }
                        },
                        {
                            path: 'ledgerDetails',
                            name: '分账明细',
                            component: () => import(/* webpackChunkName: "finance" */ '@/pages/finance/ledgerDetails/index'),
                            meta: {
                                requireAuth: true,
                                navList: ['财务管理', '分账明细']
                            }
                        },
                        {
                            path: 'settlementRecord',
                            name: '结算记录',
                            component: () => import(/* webpackChunkName: "finance" */ '@/pages/finance/settlementRecord/index'),
                            meta: {
                                requireAuth: true,
                                navList: ['财务管理', '结算记录']
                            }
                        }
                    ]
                },
                {
                    path: 'system',
                    name: '系统设置',
                    component: () => import(/* webpackChunkName: "system" */ '@/pages/common/base'),
                    redirect: 'operatorManage',
                    meta: {
                        requireAuth: true
                    },
                    children: [
                        {
                            path: 'operatorManage',
                            name: '管理员管理',
                            component: () => import(/* webpackChunkName: "system" */ '@/pages/system/operatorManage/index'),
                            meta: {
                                requireAuth: true,
                                navList: ['系统设置', '管理员管理']
                            }
                        }
                    ]
                },
                {
                    path: 'addMoney',
                    name: '充值审核',
                    component: () => import(/* webpackChunkName: "system" */ '@/pages/common/base'),
                    redirect: 'addMoneyManage',
                    meta: {
                        requireAuth: true
                    },
                    children: [
                        {
                            path: 'addMoneyManage',
                            name: '充值审核',
                            component: () => import(/* webpackChunkName: "system" */ '@/pages/addMoney/addMoneyManage/index'),
                            meta: {
                                requireAuth: true,
                            }
                        },
                        {
                            path: 'addMoneyYuan',
                            name: '充值审核',
                            component: () => import(/* webpackChunkName: "system" */ '@/pages/addMoney/addMoneyYuan/index'),
                            meta: {
                                requireAuth: true,
                            }
                        },
                        {
                            path: 'realMoney',
                            name: '提现审核',
                            component: () => import(/* webpackChunkName: "system" */ '@/pages/addMoney/realMoney/index'),
                            meta: {
                                requireAuth: true,
                            }
                        }
                    ]
                },
                {
                    path: 'user',
                    name: '用户管理',
                    component: () => import(/* webpackChunkName: "system" */ '@/pages/common/base'),
                    redirect: 'userManage',
                    meta: {
                        requireAuth: true
                    },
                    children: [
                        {
                            path: 'userManage',
                            component: () => import(/* webpackChunkName: "system" */ '@/pages/user/userManage/index'),
                            meta: {
                                requireAuth: true,
                            }
                        },
                        {
                            path: 'userManage/zhi',
                            component: () => import(/* webpackChunkName: "system" */ '@/pages/user/userManage/zhi'),
                            meta: {
                                requireAuth: true,
                            }
                        },
                        {
                            path: 'userManage/gua',
                            component: () => import(/* webpackChunkName: "system" */ '@/pages/user/userManage/gua'),
                            meta: {
                                requireAuth: true,
                            }
                        },
                        {
                            path: 'date',
                            component: () => import(/* webpackChunkName: "system" */ '@/pages/user/date/index'),
                            meta: {
                                requireAuth: true,
                            }
                        },
                        {
                            path: 'team',
                            component: () => import(/* webpackChunkName: "system" */ '@/pages/user/team/index'),
                            meta: {
                                requireAuth: true,
                            },
                   /*         children: [
                                {
                                    path: 'team/addMoney',
                                    component: () => import(/!* webpackChunkName: "system" *!/ '@/pages/user/team/operate/addMoney.vue'),
                                    meta: {
                                        requireAuth: true,
                                    }
                                },
                                {
                                    path: 'team/changeGua',
                                    component: () => import(/!* webpackChunkName: "system" *!/ '@/pages/user/team/operate/changeGua.vue'),
                                    meta: {
                                        requireAuth: true,
                                    }
                                },
                                {
                                    path: 'team/changeTui',
                                    component: () => import(/!* webpackChunkName: "system" *!/ '@/pages/user/team/operate/changeTui.vue'),
                                    meta: {
                                        requireAuth: true,
                                    }
                                }
                            ]*/
                        },
                        {
                            path: 'team/detail',
                            component: () => import(/* webpackChunkName: "system" */ '@/pages/user/team/detail'),
                            meta: {
                                requireAuth: true,
                            }
                        }
                    ]
                },
                {
                    path: 'order',
                    name: '订单管理',
                    component: () => import(/* webpackChunkName: "system" */ '@/pages/common/base'),
                    redirect: 'orderManage',
                    meta: {
                        requireAuth: true
                    },
                    children: [
                        {
                            path: 'orderManage',
                            component: () => import(/* webpackChunkName: "system" */ '@/pages/order/orderManage/index'),
                            meta: {
                                requireAuth: true,
                            }
                        },
                        {
                            path: 'orderShichang',
                            component: () => import(/* webpackChunkName: "system" */ '@/pages/order/orderShichang/index'),
                            meta: {
                                requireAuth: true,
                            }
                        },
                        {
                            path: 'orderYuan',
                            component: () => import(/* webpackChunkName: "system" */ '@/pages/order/orderYuan/index'),
                            meta: {
                                requireAuth: true,
                            }
                        },
                        {
                            path: 'dividend',
                            component: () => import(/* webpackChunkName: "system" */ '@/pages/order/orderManage/dividend/index'),
                            meta: {
                                requireAuth: true,
                            }
                        }
                    ]
                },
                {
                    path: 'allDate',
                    name: '全部数据',
                    component: () => import(/* webpackChunkName: "system" */ '@/pages/common/base'),
                    redirect: 'addMoney',
                    meta: {
                        requireAuth: true
                    },
                    children: [
                        {
                            path: 'addMoney',
                            component: () => import(/* webpackChunkName: "system" */ '@/pages/allDate/addMoney/index'),
                            meta: {
                                requireAuth: true,
                            }
                        },
                        {
                            path: 'order',
                            component: () => import(/* webpackChunkName: "system" */ '@/pages/allDate/order/index'),
                            meta: {
                                requireAuth: true,
                            }
                        },
                        {
                            path: 'dividend',
                            component: () => import(/* webpackChunkName: "system" */ '@/pages/allDate/order/dividend/index'),
                            meta: {
                                requireAuth: true,
                            }
                        },
                        {
                            path: 'realName',
                            component: () => import(/* webpackChunkName: "system" */ '@/pages/allDate/realName/index'),
                            meta: {
                                requireAuth: true,
                            }
                        },
                        {
                            path: 'realMoney',
                            component: () => import(/* webpackChunkName: "system" */ '@/pages/allDate/realMoney/index'),
                            meta: {
                                requireAuth: true,
                            }
                        },
                        {
                            path: 'user',
                            component: () => import(/* webpackChunkName: "system" */ '@/pages/allDate/user/index'),
                            meta: {
                                requireAuth: true,
                            }
                        },
                        {
                            path: 'allDate/zhi',
                            component: () => import(/* webpackChunkName: "system" */ '@/pages/allDate/user/zhi'),
                            meta: {
                                requireAuth: true,
                            }
                        },
                        {
                            path: 'allDate/gua',
                            component: () => import(/* webpackChunkName: "system" */ '@/pages/allDate/user/gua'),
                            meta: {
                                requireAuth: true,
                            }
                        },
                        {
                            path: 'allDate/detail',
                            component: () => import(/* webpackChunkName: "system" */ '@/pages/allDate/user/detail'),
                            meta: {
                                requireAuth: true,
                            }
                        }
                    ]
                },
                {
                    path: 'dataCenter',
                    name: '数据中心',
                    component: () => import(/* webpackChunkName: "system" */ '@/pages/common/base'),
                    redirect: 'yue',
                    meta: {
                        requireAuth: true
                    },
                    children: [
                        {
                            path: 'yue',
                            component: () => import(/* webpackChunkName: "system" */ '@/pages/dataCenter/yue/index.vue'),
                            meta: {
                                requireAuth: true,
                            }
                        },
                        {
                            path: 'danger',
                            component: () => import(/* webpackChunkName: "system" */ '@/pages/dataCenter/danger/index.vue'),
                            meta: {
                                requireAuth: true,
                            }
                        },
                        {
                            path: 'toMoney',
                            component: () => import(/* webpackChunkName: "system" */ '@/pages/dataCenter/toMoney/index.vue'),
                            meta: {
                                requireAuth: true,
                            }
                        },
                        {
                            path: 'dataShow',
                            component: () => import(/* webpackChunkName: "system" */ '@/pages/dataCenter/dataShow/index.vue'),
                            meta: {
                                requireAuth: true,
                            }
                        },
                        {
                            path: 'fen',
                            component: () => import(/* webpackChunkName: "system" */ '@/pages/dataCenter/fen/index.vue'),
                            meta: {
                                requireAuth: true,
                            }
                        },
                        {
                            path: 'yeji',
                            component: () => import(/* webpackChunkName: "system" */ '@/pages/dataCenter/yeji/index.vue'),
                            meta: {
                                requireAuth: true,
                            }
                        },
                        {
                            path: 'mine',
                            component: () => import(/* webpackChunkName: "system" */ '@/pages/dataCenter/mine/index.vue'),
                            meta: {
                                requireAuth: true,
                            }
                        },
                        {
                            path: 'changeYue',
                            component: () => import(/* webpackChunkName: "system" */ '@/pages/dataCenter/changeYue/index.vue'),
                            meta: {
                                requireAuth: true,
                            }
                        }
                    ]
                },
                {
                    path: 'changeRecord',
                    name: '认证记录',
                    component: () => import(/* webpackChunkName: "system" */ '@/pages/common/base'),
                    redirect: 'realName',
                    meta: {
                        requireAuth: true
                    },
                    children: [
                        {
                            path: 'realName',
                            component: () => import(/* webpackChunkName: "system" */ '@/pages/changeRecord/realName/index.vue'),
                            meta: {
                                requireAuth: true,
                            }
                        },
                    ]
                },
                {
                    path: 'change',
                    name: '变更记录',
                    component: () => import(/* webpackChunkName: "system" */ '@/pages/common/base'),
                    redirect: 'tel',
                    meta: {
                        requireAuth: true
                    },
                    children: [
                        {
                            path: 'tel',
                            component: () => import(/* webpackChunkName: "system" */ '@/pages/change/tel/index.vue'),
                            meta: {
                                requireAuth: true,
                            }
                        },
                        {
                            path: 'level',
                            component: () => import(/* webpackChunkName: "system" */ '@/pages/change/level/index.vue'),
                            meta: {
                                requireAuth: true,
                            }
                        },
                    ]
                },
                {
                    path: 'shopDecoration',
                    name: '店铺装修',
                    component: () => import(/* webpackChunkName: "system" */ '@/pages/common/base'),
                    redirect: 'shopDecoration',
                    meta: {
                        requireAuth: true
                    },
                    children: [
                        {
                            path: 'shopDecoration',
                            component: () => import(/* webpackChunkName: "system" */ '@/pages/shopDecoration/shopDecoration/index.vue'),
                            meta: {
                                requireAuth: true,
                            }
                        },
                        {
                            path: 'second',
                            component: () => import(/* webpackChunkName: "system" */ '@/pages/shopDecoration/second/index.vue'),
                            meta: {
                                requireAuth: true,
                            }
                        },
                        {
                            path: 'third',
                            component: () => import(/* webpackChunkName: "system" */ '@/pages/shopDecoration/third/index.vue'),
                            meta: {
                                requireAuth: true,
                            }
                        },
                    ]
                },
                {
                    path: 'operate',
                    name: '操作日志',
                    component: () => import(/* webpackChunkName: "system" */ '@/pages/common/base'),
                    redirect: 'operate',
                    meta: {
                        requireAuth: true
                    },
                    children: [
                        {
                            path: 'operate',
                            component: () => import(/* webpackChunkName: "system" */ '@/pages/operate/operate/index.vue'),
                            meta: {
                                requireAuth: true,
                            }
                        },
                    ]
                },
                {
                    path: 'huifu',
                    name: '汇付天下',
                    component: () => import(/* webpackChunkName: "system" */ '@/pages/common/base'),
                    redirect: 'shop',
                    meta: {
                        requireAuth: true
                    },
                    children: [
                        {
                            path: 'shop',
                            component: () => import(/* webpackChunkName: "system" */ '@/pages/huifu/shop/index.vue'),
                            meta: {
                                requireAuth: true,
                            }
                        },
                        {
                            path: 'money',
                            component: () => import(/* webpackChunkName: "system" */ '@/pages/huifu/money/index.vue'),
                            meta: {
                                requireAuth: true,
                            }
                        },
                        {
                            path: 'user',
                            component: () => import(/* webpackChunkName: "system" */ '@/pages/huifu/user/index.vue'),
                            meta: {
                                requireAuth: true,
                            }
                        },
                        {
                            path: 'user/detail',
                            component: () => import(/* webpackChunkName: "system" */ '@/pages/huifu/user/detail.vue'),
                            meta: {
                                requireAuth: true,
                            }
                        },
                        {
                            path: 'order',
                            component: () => import(/* webpackChunkName: "system" */ '@/pages/huifu/order/index.vue'),
                            meta: {
                                requireAuth: true,
                            }
                        },
                        {
                            path: 'record',
                            component: () => import(/* webpackChunkName: "system" */ '@/pages/huifu/record/index.vue'),
                            meta: {
                                requireAuth: true,
                            }
                        },
                    ]
                },
            ]
        },
        {
            path: '/decoration/index',
            name: 'DecorationPreview',
            component: () => import(/* webpackChunkName: "decoration" */ '@/pages/decoration/index/index.vue'),
            meta: {
                requireAuth: false
            }
        },
        {
            path: '/login',
            name: '用户登录',
            component: () => import(/* webpackChunkName: "home" */ '@/pages/login/login')
        },
        {
            path: '/payment/index',
            name: '扫码支付',
            component: () => import(/* webpackChunkName: "home" */ '@/pages/payment/index')
        },
        {
            path: '*',
            redirect: '/index'
        }
    ]
});
